FROM centos
MAINTAINER tutu 1130289195@qq.com

#wget
RUN yum install -y wget

#jdk
RUN mkdir /home/jdk8
RUN wget -P /home/jdk8 --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.tar.gz"
RUN tar xzf /home/jdk8/jdk-8u141-linux-x64.tar.gz -C /home/jdk8
RUN rm -rf /home/jdk8/jdk-8u141-linux-x64.tar.gz

#tomcat
RUN mkdir /home/tomcat
RUN wget -P /home/tomcat http://mirrors.hust.edu.cn/apache/tomcat/tomcat-8/v8.5.31/bin/apache-tomcat-8.5.31.tar.gz
RUN tar xzf /home/tomcat/apache-tomcat-8.5.31.tar.gz -C /home/tomcat
RUN rm -rf /home/tomcat/apache-tomcat-8.5.31.tar.gz

#maven
RUN mkdir /home/maven
RUN wget -P /home/maven  http://apache.fayea.com/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
RUN tar xzf /home/maven/apache-maven-3.3.9-bin.tar.gz -C /home/maven
RUN rm -rf /home/maven/apache-maven-3.3.9-bin.tar.gz

#evn
ENV JAVA_HOME /home/jdk8/jdk1.8.0_141
ENV CATALINA_HOME /home/tomcat/apache-tomcat-8.5.31
ENV M2_HOME /home/maven/apache-maven-3.3.9
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin:$M2_HOME/bin

#git
RUN yum install -y git


#tomcat run
CMD ["/home/tomcat/apache-tomcat-8.5.31/bin/catalina.sh","run"]

